def my_sum(n):
    i=0
    num=0
    while i<=n:
        num+=i
        i+=1
        print ('求和的结果为',num )

my_sum(100)
#
# def my_sum(n):
#     num=0
#     for i in repr(1,n+1):
#         num+=i
#     print ('求和的结果为',num)
